﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using KL.Store.Core.Domain;

namespace KL.Store.Web.Models
{
    public class ProductsModel : Category
    {
        public ProductsModel()
        {
            RelatedProducts = new List<Product>();
            FilterEnabled = false;
        }

        public string BreadCrumb { get; set; }
        public IList<Product> RelatedProducts { get; set; }
        public IList<string> SelectedBrands { get; set; }

        public int Sort { get; set; }
        public int Order { get; set; }
        public int Brand { get; set; }
        public string BrandName { get; set; }
        public string SearchText { get; set; }
        public decimal MinPriceTotal { get; set; }
        public decimal MaxPriceTotal { get; set; }
        public int ColumnCount { get; set; }
        public string ListImageType { get; set; }
        public string SearchCategories { get; set; }
        public bool BasketLocked { get; set; }
        public bool IsManager { get; set; }
        public bool IsSeoManager { get; set; }
        public int SuggestedGroup { get; set; }
        public int ShowcaseGroup { get; set; }
        public decimal VoucherRate { get; set; }
        public decimal CampaignVoucherRate { get; set; }
        public bool FilterEnabled { get; set; }
    }

    public class ProductModel : Product
    {
        public ProductModel()
        {
            PosInstallmentList = new List<IList<PosInstallment>>();
            ProductImages = new List<ProductImage>();
            LinkedProducts = new List<LinkedProduct>();
        }

        public string BreadCrumb { get; set; }
        public IList<Pos> PosList { get; set; }
        public IList<IList<PosInstallment>> PosInstallmentList { get; set; }
        public IList<ProductImage> ProductImages { get; set; }
        public bool InstallmentSelected { get; set; }
        public IList<variantProperties> variantPropertiesList { get; set; }
        public IList<variantUrls> variantUrlsList { get; set; }

        public IList<ProductTab> ProductTabsWithNewTab { get; set; }
        public IList<ProductTab> ProductTabsWithoutNewTab { get; set; }
        public IList<LinkedProduct> LinkedProducts { get; set; }
        public Category Group { get; set; }
        public bool BasketLocked { get; set; }
        public bool IsManager { get; set; }
        public bool IsSeoManager { get; set; }
    }

    public class BrandsModel
    {
        public int CategoryId { get; set; }
        public IList<Brand> Brands { get; set; }
        public string BreadCrumb { get; set; }
        public IList<string> SelectedBrands { get; set; }
    }

    public class PropertiesModel
    {
        public int CategoryId { get; set; }
        public IList<Property> Properties { get; set; }
    }

    public class PropertyModel
    {
        public string PropertiesAciklama { get; set; }
        public IList<PropertyList> Property { get; set; }
        public int siralama { get; set; }
        public IList<string> SelectedProperties { get; set; }
    }

    public class ProductInfoModel
    {
        public ProductInfoModel()
        {
            ProductInfos = new List<ProductInfo>();
        }

        public IList<ProductInfo> ProductInfos { get; set; }
        public int ProductId { get; set; }
        public int UstUrunId { get; set; }
    }

    public class ProductEditModel : Product
    {
        public virtual int ProductId { get; set; }

        [Display(Name = "Aktif")]
        public virtual bool IsActive { get; set; }

        [Display(Name = "Üst ürün ID'si")]
        public virtual int UstUrunId { get; set; }

        [Required(ErrorMessage = "Ürünün adını giriniz.")]
        [Display(Name = "Ürün Adı")]
        public virtual string ProductName { get; set; }

        [Display(Name = "Açıklama")]
        public virtual string ProductName2 { get; set; }

        [Display(Name = "Model")]
        public virtual string Model { get; set; }

        [Display(Name = "Ürün Detayı")]
        public virtual string Description { get; set; }

        [Required(ErrorMessage = "Ürünün fiyatını giriniz.")]
        [Display(Name = "Ürün Fiyatı")]
        public virtual decimal Price { get; set; }

        [Display(Name = "Alış Fiyatı")]
        public virtual decimal DealerSellingPrice { get; set; }

        [Required(ErrorMessage = "KDV Oranını giriniz.")]
        [Display(Name = "KDV Oranı")]
        public virtual decimal TaxRate { get; set; }

        [Display(Name = "Yeni Ürün")]
        public virtual bool NewProduct { get; set; }

        [Display(Name = "Hızlı Kargo")]
        public virtual bool FastCargo { get; set; }

        [Display(Name = "Ücretsiz Kargo")]
        public virtual bool FreeCargo { get; set; }

        [Display(Name = "Özel Ürün")]
        public virtual bool OpportunityProduct { get; set; }

        [Display(Name = "Kampanyalı Ürün")]
        public virtual bool CampaignProduct { get; set; }

        [Display(Name = "Kampanyalı Ürün Gösterimi")]
        public virtual bool ShowAsCampaignProduct { get; set; }

        [Display(Name = "Varyant Ürün Sayısı")]
        public virtual int VariantCount { get; set; }

        [Display(Name = "İndirim Miktarı")]
        public virtual decimal DiscountTotal { get; set; }

        [Display(Name = "İndirim Yüzdesi")]
        public virtual decimal DiscountPercent { get; set; }

        [Display(Name = "İndirim Gösterimi")]
        public virtual decimal DiscountDisplayTotal { get; set; }

        [Display(Name = "En")]
        public virtual decimal Width { get; set; }

        [Display(Name = "Boy")]
        public virtual decimal Length { get; set; }

        [Display(Name = "Yükseklik")]
        public virtual decimal Height { get; set; }

        [Display(Name = "Ağırlık")]
        public virtual decimal Weight { get; set; }

        [Display(Name = "Desi")]
        public virtual decimal Desi { get; set; }

        [Display(Name = "Hediye Metni")]
        public virtual string GiftString { get; set; }

        [Display(Name = "Özel Metin")]
        public virtual string SpecialText { get; set; }

        [Display(Name = "Teslimat")]
        public virtual string Transport { get; set; }

        [Display(Name = "Kargo Bedeli")]
        public virtual decimal CargoPrice { get; set; }

        [Display(Name = "Ek Kargo Bedeli")]
        public virtual decimal AddtCargoPrice { get; set; }

        [Display(Name = "Teslim Süresi")]
        public virtual short DeliveryTime { get; set; }

        [Display(Name = "Teslim Periyodu")]
        public virtual string DeliveryPeriod { get; set; }

        [Display(Name = "Garanti Süresi")]
        public virtual short VarrantyTime { get; set; }

        [Display(Name = "Garanti Periyodu")]
        public virtual string VarrantyPeriod { get; set; }

        [Display(Name = "Şehiriçi Ücretsiz Kargo")]
        public virtual bool FreeCargoInCity { get; set; }

        [Display(Name = "Şehiriçi Ücretsiz Kurulum")]
        public virtual bool FreeInstallmentInCity { get; set; }

        [Display(Name = "Kurulum Gerekli")]
        public virtual bool InstallmentNeeded { get; set; }

        [Display(Name = "Kurulum Ücreti")]
        public virtual decimal InstallmentPrice { get; set; }

        [Display(Name = "Stok Tut")]
        public virtual bool CheckStock { get; set; }

        public int SelectedBrand { get; set; }
        public IList<ProductGroup> Brands { get; set; }
        public IList<CategoryMenuList> Categories { get; set; }
        public bool IsAllowedBuyPrice { get; set; }
        public bool IsManager { get; set; }
    }

    public class ProductMetaEditModel : Product
    {
        [Display(Name = "Stok ID'si")]
        public virtual int ProductId { get; set; }

        [Display(Name = "Ürün Adı")]
        public virtual string ProductName { get; set; }

        [Display(Name = "Meta Description")]
        public virtual string Description { get; set; }

        [Display(Name = "Meta Keywords")]
        public virtual string Keywords { get; set; }

        [Display(Name = "Page Title")]
        public virtual string WebTitle { get; set; }

        [Display(Name = "Canonical URL")]
        public virtual string CanonicalLink { get; set; }
    }

    public class VariantListModel
    {
        public VariantListModel()
        {
            ProductList = new List<Product>();
        }

        public IList<Product> ProductList { get; set; }
        public int ProductId { get; set; }
        public string ToEdit { get; set; }
    }

    public class ProductVariantListModel
    {
        public ProductVariantListModel()
        {
            VariantList = new List<variantProperties>();
        }

        public IList<variantProperties> VariantList { get; set; }
        public int ProductId { get; set; }
        public int UstUrunId { get; set; }
        public string ToEdit { get; set; }
    }
    public class ProductGroupListModel
    {
        public ProductGroupListModel()
        {
            GroupList = new List<ProductGroups>();
        }

        public IList<ProductGroups> GroupList { get; set; }
        public int ProductId { get; set; }
    }

    public class StockAmountsModel
    {
        public StockAmountsModel()
        {

            Amounts = new List<StockAmount>();
        }
        public IList<StockAmount> Amounts { get; set; }
        public int ProductId { get; set; }

    }

    public class StockXmlImportModel
    {
        public StockXmlImportModel()
        {
            StockXml = new List<StockXmlImport>();
        }
        public IList<StockXmlImport> StockXml { get; set; }
        public int ProductId { get; set; }

    }

    public class StockPricesModel
    {
        public StockPricesModel()
        {
            Prices = new StockPrices();
        }
        public StockPrices Prices { get; set; }
        public int ProductId { get; set; }
    }

    public class LinkedProductsModel
    {
        public LinkedProductsModel()
        {
            Products = new List<LinkedProduct>();
        }
        public int ProductId { get; set; }
        public IList<LinkedProduct> Products { get; set; }
    }

}